if exists(select name from sysobjects where name = 'sp_SanPhamUpdateAnh')
	drop proc sp_SanPhamUpdateAnh
go
/*
	Created by: Phuoc NH
	Created on: 18/01/2013 (dd/mm/yyyy)
	Description: update anh vao thu muc /images/201301
	--
	File:$sql-scripts/Proc.sp_SanPhamGetAll.sql
*/

create proc sp_SanPhamUpdateAnh
@San_pham_id int,
@anh_to varchar(100),
@anh_nho varchar(100)	
as
begin
	update tbl_San_pham set Anh_nho=@anh_nho, Anh_to=@anh_to from tbl_San_pham where San_pham_id=@San_pham_id
end
go
--select anh_to from tbl_san_pham
--select right(Anh_nho, LEN(anh_nho)-7) from tbl_San_pham
--update tbl_San_pham set Anh_nho= right(Anh_nho, LEN(anh_nho)-7), Anh_to=right(Anh_to, LEN(Anh_to)-7)